import axiosInstance from "./ajax"
import type { ResDataType } from "./ajax"

type SearchOption = {
    page: number
    pageSize: number
}

// 获取错误信息列表
export async function getErrorListService(params: Partial<SearchOption> = {}): Promise<ResDataType> {
    const url = "/error"
    const data = (await axiosInstance.get(url, { params: params })) as ResDataType
    return data
}

// 获取最近7天的数据
export async function getLast7DayCountService() {
    const url = "/error/daycount"
    const data = (await axiosInstance.get(url)) as ResDataType
    return data
}
